const { resolve } = require('path')

const mongoose = require(resolve(__dirname, '../db'))

const DiscussSchema = mongoose.model('discuss', new mongoose.Schema({
  username: {  // 用户id
    type: String,
    required: [true, '用户名不可为空!'],
    trim: true
  },
  title: {  // 文章标题
    type: String,
    required: [true, '文章标题不可为空!'],
    trim: true
  },
  discuss: {  // 评论
    type: String,
    trim: true
  },
  auditStatus: {  // 审核状态
    type: Boolean,
    trim: true,
    default: true
  },
  isDel: { // 是否删除
    type: Boolean,
    trim: true,
    default: false
  }
}))

module.exports = DiscussSchema
